/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.GroupDAO;
import com.sesame.domain.Group;

/**
 * @author voidman
 * 
 */
public class GroupDAOImpl extends SqlMapClientDaoSupport implements GroupDAO {

    public void addGroup(Group Group) {
        getSqlMapClientTemplate().insert("addGroup", Group);
    }

    public void deleteGroupById(Integer id) {
        getSqlMapClientTemplate().delete("deleteGroupById", id);
    }

    @SuppressWarnings("unchecked")
    public List<Group> getAllGroup() {
        List<Group> listGroup;
        listGroup = getSqlMapClientTemplate().queryForList("getAllGroup");
        return listGroup;
    }
    
    public Group getGroupById(Integer id) {

        return (Group) getSqlMapClientTemplate().queryForObject("getGroupById", id);
    }

    public void updateGroup(Group Group) {
        getSqlMapClientTemplate().update("updateGroup", Group);
    }

}
